void starup()
{
	int i, j;
	for (i = 0; i < high; i++)
		for (j = 0; j < width; i++)
			cells[i][j] = 1;
}
void updatewithoutinput()
{
	int newcells[high][width];
	int neibournumber;
	int i, j;
	for (i = 1; i <= high - 1; i++)
	{
		for (j = 1; j <= width - 1; j++)
		{
			neibournumber = cells[i - 1][j - 1] + cells[i - 1][j] + cells[i - 1][j + 1]
				+ cells[i][j - 1] + cells[i][j + 1] + cells[i + 1][j] + cells[i + 1][j + 1];
			if (neibournumber == 3)
				newcells[i][j] = 1;
			else if (neibournumber == 2)
				newcells[i][j] = cells[i][j];
			else
				newcells[i][j] = 0;
		}
	}
	for (i = 1; i <= high - 1; i++)
		for (j = 1; j <= width - 1; j++)
			cells[i][j] = newcells[i][j];
}
